#include<bits/stdc++.h>

using namespace std;

//最大公约数的辗转相除法，对于a=0 a<b都成立的，
int main() {
    int a = 8, b = 6;
    while (b != 0) {
        int r = a % b;
        a = b;
        b = r;
    }
    cout << a;
    return 0;
}
